package com.lin.server.impl;

import com.lin.dataobject.Features;
import com.lin.repository.FeaturesRepository;
import com.lin.server.FeaturesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/9/22.
 */
@Service
public class FeaturesServiceImpl implements FeaturesService {
    @Autowired
    private FeaturesRepository featuresRepository;
    @Override
    public List<Features> findAll() {
        return featuresRepository.findAll();
    }

    @Override
    public Features findOne(Integer id) {
        return featuresRepository.findOne(id);
    }

    @Override
    public Features save(Features features) {
        return featuresRepository.save(features);
    }

    @Override
    public Long getChildrenCount(Integer id) {
        return featuresRepository.countByPid(id);
    }

    @Override
    public void del(Features features) {
        featuresRepository.delete(features);
    }
}
